package com.dk.pojo;
import lombok.Data;

@Data
public  class RESTFUL<T> {
    public int code;
    public T res;
    public String msg;

    public RESTFUL<T> SUCCESS(T t){
        this.res=t;
        this.code=200;
        this.msg="访问成功";
        return this;
    }
    public RESTFUL<T> SUCCESS(){
        this.code=200;
        this.msg="访问成功";
        return this;
    }
    public RESTFUL<T> ERR(String err,T t){
        this.code=400;
        this.msg=err;
        this.res=t;
        return this;
    }
    public RESTFUL<T> FAIL(T t){
        this.code=400;
        this.msg="输入错误";
        this.res=t;
        return this;
    }
}
